package com.example.shell;

import android.util.Log;

import java.lang.ref.WeakReference;

import org.chromium.content_public.browser.JavaScriptCallback;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.WebContentsObserver;
import org.chromium.url.GURL;

public class WebObserver extends WebContentsObserver {
  private static final String TAG = "cr_WebObserver";
  public WebObserver(WebContents webContents) {
    super(webContents);
  }

  @Override
  public void didStartLoading(GURL url) {
    Log.i(TAG, "didStartLoading:" + url.getValidSpecOrEmpty());
  }

  @Override
  public void didStopLoading(GURL url, boolean isKnownValid) {
    Log.i(TAG, "didStopLoading:" + url.getValidSpecOrEmpty());
  }

  @Override
  public void didFailLoad(boolean isInPrimaryMainFrame, int errorCode, GURL failingUrl, int rfhLifecycleState) {
    Log.i(TAG, "didFailLoad:" + failingUrl.getValidSpecOrEmpty());
  }
}

